<form class="form-inline" method="get">

    <div class="form-group col-xs-2">
        <div class="col-xs-12">
            <input class="form-control" name="user_condition" value="{$user_condition}"
                   placeholder="会员手机|会员姓名|会员ID">
        </div>
    </div>
    <div class="form-group col-xs-2">
        <div class="col-xs-12">
            <input class="form-control" name="un_condition" value="{$un_condition}"
                   placeholder="联盟商名称|联盟商ID">
        </div>
    </div>
    <div class="form-group col-xs-2">
        <div class="col-xs-12">
            <input class="form-control" name="ac_condition" value="{$ac_condition}"
                   placeholder="活动主题|活动ID">
        </div>
    </div>
    <div class="form-group col-xs-2">
        <div class="col-xs-12">
            <input class="form-control" name="or_condition" value="{$or_condition}"
                   placeholder="订单ID|订单号">
        </div>
    </div>

    <div class="form-group col-xs-2">
        <div class="col-xs-12">
            <select id="type-selector" name="order_type" class="form-control" tabindex="-1">
                <option value="">无选择</option>
                <?php foreach($type_list as $itk=>$item){ ?>
                <option value="{$itk}" {if condition="$order_type==$itk"}selected{/if}>{$item}</option>
                <?php } ?>
            </select>
        </div>
    </div>

    <div class="form-group col-xs-2">
        <div class="col-xs-12">
            <select id="pay-status-selector" name="pay_status" class="form-control" tabindex="-1">
                <option value="">无选择</option>
                <?php foreach($pay_status_list as $itk=>$item){ ?>
                <option value="{$itk}" {if condition="$pay_status!=''&&$pay_status==$itk"}selected{/if}>{$item}</option>
                <?php } ?>
            </select>
        </div>
    </div>
    <br><br><br>
    <div class="form-group col-xs-2">
        <div class="col-xs-12">
            <select id="count-status-selector" name="count_status" class="form-control" tabindex="-1">
                <option value="">无选择</option>
                <?php foreach($count_status_list as $itk=>$item){ ?>
                <option value="{$itk}" {if condition="$count_status!=''&&$count_status==$itk"}selected{/if}>{$item}</option>
                <?php } ?>
            </select>
        </div>
    </div>
    <div class="form-group col-xs-3">
        <div class="col-xs-12">
            <span style="">创建时间</span>{include file="public/dateRangePicker" picker-name="time_range" /}
        </div>
    </div>

    <div class="form-group col-xs-2">
        <div class="col-xs-12">
            <button type="submit" class="btn btn-success">
                搜索
            </button>
        </div>
    </div>
</form>

<hr>

<table class="table table-striped">
    <thead>
    <tr>
        <td>ID</td>
        <td>会员</td>
        <td>联盟商</td>
        <td>活动</td>
        <td>订单类型</td>
        <td>订单号</td>
        <td>支付</td>
        <td>订单金额</td>
        <td>结算给联盟商</td>
        <td>时间</td>
        <!--<td>操作</td>-->
    </tr>
    </thead>
    <tbody>
    {volist name="list" id="item"}
    <tr>
        <td>{$item.id}</td>
        <td>
            <label class="label label-danger">{$item.umobile}【ID：{$item.uid}】</label>
        </td>
        <td>
            {$item.untitle}【ID：{$item.union_id}】
        </td>
        <td>
            {if condition="$item.active_id gt 0"}
            {$item.actitle|default='未查到'}【ID：{$item.active_id}】
            {/if}
        </td>
        <td>{$item.order_type|get_order_type}</td>
        <td>
           <label class="label label-success">{$item.orderid}</label>
        </td>
        <td>
            <p>方式：{$item.pay_type|get_pay_type}</p>
            <p>状态：{$item.pay_status|get_pay_status}</p>

        </td>
        <td>
            {if condition="$item.order_type==3"}
            <p>
                <label class="label label-warning">输入总金额：￥{$item.all_money}</label>
            </p>
            {/if}
            <p>
                <label class="label label-warning">实际支付现金：￥{$item.money}</label>
            </p>
            {if condition="$item.order_type!=1"}
            <p>
                <label class="label label-warning">H链费用：{$item.coin}</label>
            </p>
            {/if}
        </td>
        <td>
            {if condition="$item.order_type==1"}
            无
            {else/}
            <p>
                <label class="label label-warning">现金结算扣费：￥{$item.money_cut}</label>
            </p>
            <p>H链结算：{$item.count_status|get_count_status}</p>
            <p>
                <label class="label label-warning">H链结算扣费：{$item.coin_cut}</label>
            </p>
            {/if}
        </td>
        <td>
            <p>创建时间：{$item.create_time|show_datetime}</p>
            <p>支付时间：{$item.pay_time|show_datetime}</p>
        </td>
        <!--<td>-->
            <!--<div class="btn-group">-->
                <!--<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">-->
                    <!--操作-->
                    <!--<span class="caret"></span>-->
                <!--</button>-->
                <!--<ul class="dropdown-menu">-->
                    <!--<li>-->
                        <!--<a href="javascript:void(0)" data-toggle="confirm"-->
                           <!--data-title="删除评论"-->
                           <!--data-content="评论将会被删除，确认删除？"-->
                           <!--data-url="{:url('remove',array('id'=>$item['id']))}">-->
                            <!--删除-->
                        <!--</a>-->
                    <!--</li>-->
                    <!--<li role="separator" class="divider"></li>-->
                <!--</ul>-->
            <!--</div>-->
        <!--</td>-->

    </tr>
    {/volist}
    </tbody>
</table>

<div class="row">
    <div class="col-xs-12" style="text-align: right;">
        {$list->render()}
    </div>
</div>

<script src="__PUBLIC__/vendors/select2/js/select2.min.js"></script>
<script type="application/javascript">
    $(function () {

        //获取分类
        $("#type-selector").select2({
            placeholder: "选择订单类型",
            allowClear: true
        });
        $("#pay-status-selector").select2({
            placeholder: "选择支付状态",
            allowClear: true
        });
        $("#count-status-selector").select2({
            placeholder: "选择H链结算状态",
            allowClear: true
        });
    });
</script>